
#include <stdint.h>
#include "../lot_State.h"
#include "../Grill_State.h"
#include "../aws_esp32/MqttSubscribe_Data.h"

#ifndef LCD_AWS_INTERFACE_H
#define LCD_AWS_INTERFACE_H

typedef enum
{
    Option_None = 0,
    Option_RTD_Setting,
    Option_Timer_Hour_Setting,
    Option_Timer_Minute_Setting,
    Option_P1_Setting,
    Option_P2_Setting,
}Lcd_Options_E;
extern Lcd_Options_E Lcd_Options;
typedef struct
{
    uint16_t RTD_Temp;
    uint16_t P1_Temp;
    uint16_t P2_Temp;
    uint8_t Grill_Unit; //0: F, 1: C
}I_TempCtrl_Param_S;
extern I_TempCtrl_Param_S I_TempCtrl_Param;

typedef enum
{
    MenuItem_RTD = 0,
    MenuItem_Probe1,
    MenuItem_Probe2,
    MenuItem_Smoke,
    MenuItem_Warm,
}Menu_Item_T;
typedef enum
{
    MenuStep_1 = 0, //Cook Menu Stemp 1
    MenuStep_2,
    MenuStep_3,
    MenuStep_4,
    MenuStep_5,
    MenuStep_Exit,  //Cook menu exit
}Menu_T;
extern Menu_T Cook_Menu;

extern uint8_t CooK_MenuItem_Length;

uint16_t UI_Home_Get_RTDTemp(void);
uint16_t UI_ProbeA_GetTemp(void);
uint16_t UI_ProbeB_GetTemp(void);
uint32_t Timer1_Downcount_Getting(void);
uint32_t Timer1_GetSetting(void);
void UI_SetUnit(uint8_t x);
uint8_t Get_Unit_Grill(void);
void UI_SetMenu(void);
void SetMenuItem(uint8_t seq);
void UI_MenuAuto(void);

uint16_t I_Lcd_GetRTDSetting(void);

void I_Lcd_SetRTD(uint16_t temp);
void Timer1_Setting(uint32_t x);
void Timer1_Reset(void);
uint32_t UI_Timer_GetTimer1Set(void);

void UI_ProbeA_Setting(uint16_t x);
void UI_ProbeB_Setting(uint16_t x);
uint16_t UI_ProbeA_GetSetting(void);
uint16_t UI_ProbeB_GetSetting(void);

void UI_Alot_StateHandle(Alot_State_E state);
void UI_Grill_StateHandle(Grill_State_E state);
uint32_t UI_Shuttdown_GetTime(void);
uint8_t Get_State_Heat(void);
uint8_t Get_State_Grill(void);
uint8_t Get_State_Error(void);
uint8_t UI_Timer_GetTimer1Alert(void);
uint8_t UI_Probe_GetProbeAAlert(void);
uint8_t UI_Probe_GetProbeBAlert(void);

void Subscribe_CmdHandle(MqttSubscribe_Msg_S msg);

#endif
